package test_new;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

public class SymbolsCounter  {
	
	int count(FileContentGetter fileContent){
		return factorial(count(stringUnique(fileContent.getContent())));
	}
	
	Collection stringUnique (Collection strings){
		Set result = new HashSet(strings);		
		return result;
	}
	
	int count (Collection strings){
		int result = 0;
		for (Object o : strings) {
			String s = (String) o;
			result += s.length();
		}
		return result;
		
	}

	private int factorial(int symbolSumm) {
		int result = 1;
		for (int i=symbolSumm; i>=1; i--) {
			result = result * i;
		}
		return result;
	}

}
